home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Commands / Protocols / Undoing.cp < prev    next >
Text File  |  2000-06-23  |  308b  |  27 lines

  1. // Undoing.cp
  2.  
  3. #ifndef Undoing_h
  4. #include "Undoing.h"
  5. #endif
  6.  
  7. bool Undoing::CanUndoOrRedo() const
  8.   {
  9.     return ActionIsDone()
  10.                 ? CanUndo()
  11.                 : CanRedo();
  12.   }
  13.  
  14. void Undoing::UndoOrRedo()
  15.   {
  16.     if ( ActionIsDone() )
  17.       {
  18.         if ( CanUndo() )
  19.             Undo();
  20.       }
  21.      else
  22.       {
  23.         if ( CanRedo() )
  24.             Redo();
  25.       }
  26.   }
  27.